import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import School from '../views/School.vue'
import User from '../views/User.vue'
import Resume from '../views/Resume.vue'
import Intern from '../views/Intern.vue'
import Write from '../views/Write.vue'
import Interview from '../views/Interview.vue'
import Help from '../views/Help.vue'
import System from '../views/System.vue'
import SystemUser from '../views/system/User.vue'
import SystemProblem from '../views/system/Problem.vue'
import SystemItem from '../views/system/Item.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/school',
    name: 'School',
    component: School
  },
  {
    path: '/intern',
    name: 'Intern',
    component: Intern
  },
  {
    path: '/resume',
    name: 'Resume',
    component: Resume
  },
  {
    path: '/write',
    name: 'Write',
    component: Write
  },
  {
    path: '/interview',
    name: 'Interview',
    component: Interview
  },
  {
    path: '/help',
    name: 'Help',
    component: Help
  },
  {
    path: '/user',
    name: 'User',
    component: User
  },
  {
    path: '/system',
    name: 'System',
    component: System,
    redirect: '/system/problem', // 默认子页面
    children: [
      { path: 'user', name: 'SystemUser', component: SystemUser },
      { path: 'problem', name: 'SystemProblem', component: SystemProblem },
      { path: 'item', name: 'SystemItem', component: SystemItem }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
    meta: { fullScreen: true }
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router